package cn.buk.qms.service;

import cn.buk.common.JsonResult;
import cn.buk.common.dto.CommonDto;
import cn.buk.tms.dto.FlightRefundOrderDto;
import cn.buk.tms.entity.misc.OperationLog;
import cn.buk.tms.entity.order.OrderAttachment;
import cn.buk.tms.sc.SearchFlightOrderCriteria;
import cn.buk.tms.flight.dto.response.RefundOrderResponseDto;

import java.util.List;

/**
 * 机票退票订单服务接口类
 */
public interface FlightRefundOrderService {

  /**
   * 创建退票单
   */
  JsonResult createFlightRefundOrder(int enterpriseId, String username, FlightRefundOrderDto dto);

  /**
   * 创建退票单（多人一起提交）
   */
  JsonResult createFlightRefundOrderV2(int enterpriseId, String username, FlightRefundOrderDto dto);

  /**
   * 我来处理，认领退票处理
   */
  JsonResult processFlightRefund(int enterpriseId, String operator, int orderId);

  JsonResult cancelFlightRefund(int enterpriseId, String operator, int id);

  JsonResult reopenFlightRefund(int enterpriseId, String operator, int id);

  /**
   * 已提交退票
   */
  JsonResult submitFlightRefund(int enterpriseId, String operator, int orderId);

  /**
   * 填写航司预退金额
   */
  JsonResult setFlightRefundAirlineRefundedAmount(int enterpriseId, String username, int id, double airlineRefundAmount);

  JsonResult setFlightRefundAirlineRefundedStatus(int enterpriseId, String username, int id);

  JsonResult setFlightRefundPassengerRefundedAmount(int enterpriseId, String username, int id, double amount);

  JsonResult setFlightRefundPassengerRefundedStatus(int enterpriseId, String username, int id);

  /**
   * 查找退票单
   */
  List<RefundOrderResponseDto> searchFlightRefundOrder(int enterpriseId, int userId, SearchFlightOrderCriteria sc);
  CommonDto<RefundOrderResponseDto> searchFlightRefundOrder2(int enterpriseId, int userId, SearchFlightOrderCriteria sc);

  RefundOrderResponseDto getFlightRefundOrderDetail(int enterpriseId, int userId, int id);

  RefundOrderResponseDto getFlightRefundOrderDetailByRefundOrderNo(int enterpriseId, String refundOrderNo);

  List<OperationLog> searchFlightRefundOrderHistory(int enterpriseId, int id);


  JsonResult updateRefundOrderPrice(int enterpriseId, String username, int id, double airRefundCharge, double serviceCharge);

  JsonResult updateRefundOrderRemark(int enterpriseId, String username, int id, String remark);

  JsonResult setFinallyAirRefunded(int enterpriseId, String username, int id, double amount);

  /**
   * 回滚退票单状态
   */
  JsonResult rollbackRefundOrderStatus(int enterpriseId, String username, int orderId, final String remark);

  /**
   * 获取根据订单内容生成的短信内容
   */
  JsonResult getFlightRefundOrderSmsContent(int enterpriseId, String username, int orderId, int smsFormat);

  JsonResult sendFlightRefundOrderSms(int enterpriseId, String username, int orderId, String mobileNo, int smsFormat, String smsContent);

  /**
   * 修改退票单的票号
   *
   * @param enterpriseId 企业ID
   * @param username     用户名
   * @param orderId      订单ID
   * @param ticketNo     新票号
   */
  JsonResult updateRefundOrderTicketNo(int enterpriseId, String username, int orderId, String ticketNo);

  JsonResult saveRefundOrderAttachment(int enterpriseId, String username, int orderId, List<OrderAttachment> attachments);

  /**
   * 刷新退票单的票号的DETR状态
   */
  void refreshRefundOrderDetrDetail(int enterpriseId, String username);

  JsonResult sendWeixinTplMsg(int enterpriseId, int id);

  /**
   *  CZ NDC 创建退票单
   */
  JsonResult createNdcOrderRefund(int enterpriseId, String username, int orderId);

  /**
   * CZ NDC 查询退票单
   */
  JsonResult syncNdcOrderRefundInfo(int enterpriseId, String username, int orderId);
}
